package cn.kimming.wms.query;


import cn.kimming.wms.util.StringUtils;
import lombok.Getter;
import lombok.Setter;

public class EmployeeQueryObject extends QueryObject {

	@Setter @Getter
	private String keyword;
	@Setter @Getter
	private Long deptId = -1L;

	@Override
	protected void customizedQuery() {
		if (!StringUtils.isEmpty(keyword)) {
			addCondition("(obj.name LIKE ? OR obj.email LIKE ?)", "%" + keyword + "%", "%" + keyword + "%");
		}
		if (deptId > 0) {
			addCondition("obj.dept.id = ?", deptId);
		}
	}
}
